﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Web;

namespace AgendaManager
{
    public static class ConnectHelper
    {
        public static AgendaService.Service1 ws = new AgendaService.Service1();

        public static void Connect()
        {
            try
            {
                //XmlDocument xmlDoc = LoadXmlDocument("Settings.xml");
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load("App_Data/Settings.xml");
                ws.Url = xmlDoc.SelectSingleNode("Settings/url").InnerText;
            }
            catch (Exception)
            {
                
                throw;
            }
            
        }

        private static XmlDocument LoadXmlDocument(string fileName)
        {
            //string xmlPath = XmlDocument.Load("RESTORE.XML"); //HttpContext.Current.Server.MapPath("~/App_Data/" + fileName);
            XmlDocument xmlDoc = new XmlDocument();
            //xmlDoc.Load(xmlPath);

            return xmlDoc;
        }
    }
}
